package com.stormrage.edu.dao.learn.impl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.stormrage.edu.dao.learn.LeaBunchDao;
import com.stormrage.entity.learn.LeaBunch;
import com.stormragetech.core.dao.MysBaseDao;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @Title: LeaBunchServImpl.java
 * @Package com.stormrage.edu.dao.learn.impl
 * @Description: 班级 Dao
 * @author www.stormragetech.com
 * @date 2016年5月9日
 * @version V1.0
 */
@Repository
public class LeaBunchDaoImpl extends MysBaseDao implements LeaBunchDao {

	private static final Logger logger = LoggerFactory.getLogger(LeaBunchDaoImpl.class);

	@Override
	public List<LeaBunch> queryListByStuId(Map<String, Object> map) throws StormrageTechException {

		logger.debug(" 【 Dao 】-【 LeaBunchDao 】-【 queryListByStuId 】- 开始运行 ");

		final String query = "SELECT b.* FROM lea_student AS a, lea_bunch AS b WHERE a.bunch_id = b.id"
				+ " AND a.acct_id = :acctId";
		logger.debug(" 数据库执行语句为 " + query);

		List<LeaBunch> array = queryList(query, LeaBunch.class, map);

		logger.debug(" 【 Dao 】-【 LeaBunchDao 】-【 queryListByStuId 】- 完成运行 ");
		return array;

	}

}
